package org.jeecg.modules.demo3.fly.entity.tcp;

import lombok.Data;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.net.Socket;

/**
 * @author wjn
 * @version V1.0
 * @date 2021/3/29 8:52
 * @Copyright © 2021/3/29 深圳卓翼航空无人机有限公司
 */
@Data
public class Clents implements Serializable {

    private int Number = 0; //序列号
    private Socket socket; //客户端socket
    private InputStream is; //输入流
    private OutputStream os; //输出流
    private int sta; //状态标记

    public Clents() {
    }

    public Clents( Socket socket) throws IOException {
        this.socket = socket;
        this.is = socket.getInputStream();
        this.os = socket.getOutputStream();
    }

    public int getNumber() {
        return Number;
    }

    public void setNumber(int number) {
        Number = number;
    }

    public Socket getSocket() {
        return socket;
    }

    public void setSocket(Socket socket) {
        this.socket = socket;
    }

    public InputStream getIs() {
        return is;
    }

    public void setIs(InputStream is) {
        this.is = is;
    }

    public OutputStream getOs() {
        return os;
    }

    public void setOs(OutputStream os) {
        this.os = os;
    }


    @Override
    public String toString() {
        return "Clents{" +
                "Number=" + Number +
                ", socket=" + socket +
                ", is=" + is +
                ", os=" + os +
                ", sta=" + sta +
                '}';
    }
}
